
/*
Output: Table 1. Parcel and Owner Counts by Engagement Group
*/


run "/Users/holyfantastic/Dropbox/Forest/Paper/Nature/FinalDocuments/Code/000declare_path" // change to your local path

**# Parcel
use "ParcelLevelDataSept282023_VerNov82024_R1.dta" , clear
*keep a snapshot of 2022
keep if year == 2022
*Requiring at least one acre of forest
drop if forestAcres<1

preserve
collapse (max) group , by(taxidnum)
tab group, matcell(matrix1)
mat define matrix1 = matrix1 \ r(N)
matrix rownames matrix1 = "Unegaged" "Declined" "In Process" "Enrolled" "Total"
matrix colnames matrix1 = "Parcels"
restore




**# Owner
use "ParcelLevelDataSept282023_VerNov82024_R1.dta" , clear
*keep a snapshot of 2022
keep if year == 2022

*Requiring at least one acre of forest
drop if forestAcres<1

preserve
collapse (max) group , by(owner_key)
tab group, matcell(matrix2)
mat define matrix2 = matrix2 \ r(N)
matrix rownames matrix2 = "Unegaged" "Declined" "In Process" "Enrolled" "Total"
matrix colnames matrix2 = "Owners"
restore

matrix define matrix3 = matrix1, matrix2


foreach tab_path in table {
	
	 	dis  "$`tab_path'/table_1_R1.tex"

esttab matrix(matrix3) using  "$`tab_path'/table_1_R1.tex" , replace  compress label  booktabs  nomtitles nogaps  alignment(cc) 

}
